using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
 

using System.Data.SqlClient;
using DALCore.Data;
public partial class _Default : System.Web.UI.Page
{
    private static string ConnStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString();
    private static SqlConnection SQLConn = new SqlConnection(ConnStr);
    private DataProvider dp = new DataProvider(SQLConn);
    protected void Page_Load(object sender, EventArgs e)
    {


    }
 
    void DisplayRecords() {

        DataSet ds = dp.getDataSet("select ContactID,FirstName,MiddleName,LastName,Suffix,EmailAddress from  Person.Contact");
        GridView1.DataSource = ds;
        GridView1.DataBind();
    }

    protected void Display_Button_Click(object sender, EventArgs e)
    {
        DisplayRecords();
    }
    protected void Update_Button_Click(object sender, EventArgs e)
    {
        dp.ExecuteNonQuery("Update Person.Contact set FirstName='" + Name_TextBox.Text + "' where ContactID=" + ID_TextBox.Text);
        DisplayRecords();
    }
 
}
